package com.ruoyi.quartz.service.impl;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.common.constant.ScheduleConstants;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.exception.job.TaskException;
import com.ruoyi.framework.util.ShiroUtils;
import com.ruoyi.quartz.domain.SysJob;
import com.ruoyi.quartz.mapper.CornLogMapper;
import com.ruoyi.quartz.mapper.CustomerMapper;
import com.ruoyi.quartz.mapper.OrderMapper;
import com.ruoyi.quartz.mapper.UpdateMapper;
import com.ruoyi.quartz.service.IOrderService;
import com.ruoyi.quartz.service.ISysJobService;
import com.ruoyi.quartz.service.IUpdateService;
import com.ruoyi.quartz.util.ScheduleUtils;
import com.ruoyi.system.domain.DTO.*;
import com.ruoyi.system.domain.SysUser;
import com.ruoyi.system.domain.vo.*;
import org.apache.commons.lang3.StringUtils;
import org.quartz.Scheduler;
import org.quartz.SchedulerException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.math.BigDecimal;
import java.nio.charset.Charset;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;


@Service
@Transactional
public class UpdateServiceImpl implements IUpdateService {

    @Autowired
    private UpdateMapper updateMapper;


    @Override
    public List<UpdateVo> list(UpdateDto updateDto) {
        return updateMapper.selectOrderJobByIsFor2(updateDto);
    }

    @Override
    public AjaxResult update(UpdateDto updateDto) {
        Boolean result= updateMapper.update(updateDto);
        if(result){
            return AjaxResult.success();
        }
        return AjaxResult.error();
    }
    @Override
    public AjaxResult update2(UpdateDto updateDto) {
        Boolean result= updateMapper.update2(updateDto);
        if(result){
            return AjaxResult.success();
        }
        return AjaxResult.error();
    }

}
